Left Termination of the query pattern shanoi_in_5(g, g, g, g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

shanoi(s(0), A, B, C, .(mv(A, C), [])).
shanoi(s(s(X)), A, B, C, M) :- ','(eq(N1, s(X)), ','(shanoi(N1, A, C, B, M1), ','(shanoi(N1, B, A, C, M2), ','(append(M1, .(mv(A, C), []), T), append(T, M2, M))))).
append([], L, L).
append(.(H, L), L1, .(H, R)) :- append(L, L1, R).
eq(X, X).

Queries:

shanoi(g,g,g,g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in(x1, x2, x3, x4, x5)  =  shanoi_in(x1, x2, x3, x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x2, x3, x4, x6)
eq_in(x1, x2)  =  eq_in(x2)
eq_out(x1, x2)  =  eq_out(x1)
U2(x1, x2, x3, x4, x5, x6, x7)  =  U2(x2, x3, x4, x6, x7)
0  =  0
.(x1, x2)  =  .(x1, x2)
mv(x1, x2)  =  mv(x1, x2)
[]  =  []
shanoi_out(x1, x2, x3, x4, x5)  =  shanoi_out(x5)
U3(x1, x2, x3, x4, x5, x6, x7)  =  U3(x2, x4, x6, x7)
U4(x1, x2, x3, x4, x5, x6, x7)  =  U4(x6, x7)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U6(x1, x2, x3, x4, x5)  =  U6(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in(x1, x2, x3, x4, x5)  =  shanoi_in(x1, x2, x3, x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x2, x3, x4, x6)
eq_in(x1, x2)  =  eq_in(x2)
eq_out(x1, x2)  =  eq_out(x1)
U2(x1, x2, x3, x4, x5, x6, x7)  =  U2(x2, x3, x4, x6, x7)
0  =  0
.(x1, x2)  =  .(x1, x2)
mv(x1, x2)  =  mv(x1, x2)
[]  =  []
shanoi_out(x1, x2, x3, x4, x5)  =  shanoi_out(x5)
U3(x1, x2, x3, x4, x5, x6, x7)  =  U3(x2, x4, x6, x7)
U4(x1, x2, x3, x4, x5, x6, x7)  =  U4(x6, x7)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U6(x1, x2, x3, x4, x5)  =  U6(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x6)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

SHANOI_IN(s(s(X)), A, B, C, M) → U11(X, A, B, C, M, eq_in(N1, s(X)))
SHANOI_IN(s(s(X)), A, B, C, M) → EQ_IN(N1, s(X))
U11(X, A, B, C, M, eq_out(N1, s(X))) → U21(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
U11(X, A, B, C, M, eq_out(N1, s(X))) → SHANOI_IN(N1, A, C, B, M1)
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U31(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → SHANOI_IN(N1, B, A, C, M2)
U31(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U41(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
U31(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → APPEND_IN(M1, .(mv(A, C), []), T)
APPEND_IN(.(H, L), L1, .(H, R)) → U61(H, L, L1, R, append_in(L, L1, R))
APPEND_IN(.(H, L), L1, .(H, R)) → APPEND_IN(L, L1, R)
U41(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U51(X, A, B, C, M, append_in(T, M2, M))
U41(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → APPEND_IN(T, M2, M)

The TRS R consists of the following rules:

shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in(x1, x2, x3, x4, x5)  =  shanoi_in(x1, x2, x3, x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x2, x3, x4, x6)
eq_in(x1, x2)  =  eq_in(x2)
eq_out(x1, x2)  =  eq_out(x1)
U2(x1, x2, x3, x4, x5, x6, x7)  =  U2(x2, x3, x4, x6, x7)
0  =  0
.(x1, x2)  =  .(x1, x2)
mv(x1, x2)  =  mv(x1, x2)
[]  =  []
shanoi_out(x1, x2, x3, x4, x5)  =  shanoi_out(x5)
U3(x1, x2, x3, x4, x5, x6, x7)  =  U3(x2, x4, x6, x7)
U4(x1, x2, x3, x4, x5, x6, x7)  =  U4(x6, x7)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U6(x1, x2, x3, x4, x5)  =  U6(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x6)
U51(x1, x2, x3, x4, x5, x6)  =  U51(x6)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)
U41(x1, x2, x3, x4, x5, x6, x7)  =  U41(x6, x7)
U31(x1, x2, x3, x4, x5, x6, x7)  =  U31(x2, x4, x6, x7)
U21(x1, x2, x3, x4, x5, x6, x7)  =  U21(x2, x3, x4, x6, x7)
U61(x1, x2, x3, x4, x5)  =  U61(x1, x5)
U11(x1, x2, x3, x4, x5, x6)  =  U11(x2, x3, x4, x6)
EQ_IN(x1, x2)  =  EQ_IN(x2)
SHANOI_IN(x1, x2, x3, x4, x5)  =  SHANOI_IN(x1, x2, x3, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

SHANOI_IN(s(s(X)), A, B, C, M) → U11(X, A, B, C, M, eq_in(N1, s(X)))
SHANOI_IN(s(s(X)), A, B, C, M) → EQ_IN(N1, s(X))
U11(X, A, B, C, M, eq_out(N1, s(X))) → U21(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
U11(X, A, B, C, M, eq_out(N1, s(X))) → SHANOI_IN(N1, A, C, B, M1)
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U31(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → SHANOI_IN(N1, B, A, C, M2)
U31(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U41(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
U31(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → APPEND_IN(M1, .(mv(A, C), []), T)
APPEND_IN(.(H, L), L1, .(H, R)) → U61(H, L, L1, R, append_in(L, L1, R))
APPEND_IN(.(H, L), L1, .(H, R)) → APPEND_IN(L, L1, R)
U41(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U51(X, A, B, C, M, append_in(T, M2, M))
U41(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → APPEND_IN(T, M2, M)

The TRS R consists of the following rules:

shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in(x1, x2, x3, x4, x5)  =  shanoi_in(x1, x2, x3, x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x2, x3, x4, x6)
eq_in(x1, x2)  =  eq_in(x2)
eq_out(x1, x2)  =  eq_out(x1)
U2(x1, x2, x3, x4, x5, x6, x7)  =  U2(x2, x3, x4, x6, x7)
0  =  0
.(x1, x2)  =  .(x1, x2)
mv(x1, x2)  =  mv(x1, x2)
[]  =  []
shanoi_out(x1, x2, x3, x4, x5)  =  shanoi_out(x5)
U3(x1, x2, x3, x4, x5, x6, x7)  =  U3(x2, x4, x6, x7)
U4(x1, x2, x3, x4, x5, x6, x7)  =  U4(x6, x7)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U6(x1, x2, x3, x4, x5)  =  U6(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x6)
U51(x1, x2, x3, x4, x5, x6)  =  U51(x6)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)
U41(x1, x2, x3, x4, x5, x6, x7)  =  U41(x6, x7)
U31(x1, x2, x3, x4, x5, x6, x7)  =  U31(x2, x4, x6, x7)
U21(x1, x2, x3, x4, x5, x6, x7)  =  U21(x2, x3, x4, x6, x7)
U61(x1, x2, x3, x4, x5)  =  U61(x1, x5)
U11(x1, x2, x3, x4, x5, x6)  =  U11(x2, x3, x4, x6)
EQ_IN(x1, x2)  =  EQ_IN(x2)
SHANOI_IN(x1, x2, x3, x4, x5)  =  SHANOI_IN(x1, x2, x3, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 7 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN(.(H, L), L1, .(H, R)) → APPEND_IN(L, L1, R)

The TRS R consists of the following rules:

shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in(x1, x2, x3, x4, x5)  =  shanoi_in(x1, x2, x3, x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x2, x3, x4, x6)
eq_in(x1, x2)  =  eq_in(x2)
eq_out(x1, x2)  =  eq_out(x1)
U2(x1, x2, x3, x4, x5, x6, x7)  =  U2(x2, x3, x4, x6, x7)
0  =  0
.(x1, x2)  =  .(x1, x2)
mv(x1, x2)  =  mv(x1, x2)
[]  =  []
shanoi_out(x1, x2, x3, x4, x5)  =  shanoi_out(x5)
U3(x1, x2, x3, x4, x5, x6, x7)  =  U3(x2, x4, x6, x7)
U4(x1, x2, x3, x4, x5, x6, x7)  =  U4(x6, x7)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U6(x1, x2, x3, x4, x5)  =  U6(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x6)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN(.(H, L), L1, .(H, R)) → APPEND_IN(L, L1, R)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND_IN(.(H, L), L1) → APPEND_IN(L, L1)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

SHANOI_IN(s(s(X)), A, B, C, M) → U11(X, A, B, C, M, eq_in(N1, s(X)))
U11(X, A, B, C, M, eq_out(N1, s(X))) → SHANOI_IN(N1, A, C, B, M1)
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → SHANOI_IN(N1, B, A, C, M2)
U11(X, A, B, C, M, eq_out(N1, s(X))) → U21(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))

The TRS R consists of the following rules:

shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)

The argument filtering Pi contains the following mapping:
shanoi_in(x1, x2, x3, x4, x5)  =  shanoi_in(x1, x2, x3, x4)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x2, x3, x4, x6)
eq_in(x1, x2)  =  eq_in(x2)
eq_out(x1, x2)  =  eq_out(x1)
U2(x1, x2, x3, x4, x5, x6, x7)  =  U2(x2, x3, x4, x6, x7)
0  =  0
.(x1, x2)  =  .(x1, x2)
mv(x1, x2)  =  mv(x1, x2)
[]  =  []
shanoi_out(x1, x2, x3, x4, x5)  =  shanoi_out(x5)
U3(x1, x2, x3, x4, x5, x6, x7)  =  U3(x2, x4, x6, x7)
U4(x1, x2, x3, x4, x5, x6, x7)  =  U4(x6, x7)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U6(x1, x2, x3, x4, x5)  =  U6(x1, x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4, x5, x6)  =  U5(x6)
U21(x1, x2, x3, x4, x5, x6, x7)  =  U21(x2, x3, x4, x6, x7)
U11(x1, x2, x3, x4, x5, x6)  =  U11(x2, x3, x4, x6)
SHANOI_IN(x1, x2, x3, x4, x5)  =  SHANOI_IN(x1, x2, x3, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ Rewriting

Q DP problem:
The TRS P consists of the following rules:

U11(A, B, C, eq_out(N1)) → U21(A, B, C, N1, shanoi_in(N1, A, C, B))
U21(A, B, C, N1, shanoi_out(M1)) → SHANOI_IN(N1, B, A, C)
SHANOI_IN(s(s(X)), A, B, C) → U11(A, B, C, eq_in(s(X)))
U11(A, B, C, eq_out(N1)) → SHANOI_IN(N1, A, C, B)

The TRS R consists of the following rules:

shanoi_in(s(s(X)), A, B, C) → U1(A, B, C, eq_in(s(X)))
eq_in(X) → eq_out(X)
U1(A, B, C, eq_out(N1)) → U2(A, B, C, N1, shanoi_in(N1, A, C, B))
shanoi_in(s(0), A, B, C) → shanoi_out(.(mv(A, C), []))
U2(A, B, C, N1, shanoi_out(M1)) → U3(A, C, M1, shanoi_in(N1, B, A, C))
U3(A, C, M1, shanoi_out(M2)) → U4(M2, append_in(M1, .(mv(A, C), [])))
append_in(.(H, L), L1) → U6(H, append_in(L, L1))
append_in([], L) → append_out(L)
U6(H, append_out(R)) → append_out(.(H, R))
U4(M2, append_out(T)) → U5(append_in(T, M2))
U5(append_out(M)) → shanoi_out(M)

The set Q consists of the following terms:

shanoi_in(x0, x1, x2, x3)
eq_in(x0)
U1(x0, x1, x2, x3)
U2(x0, x1, x2, x3, x4)
U3(x0, x1, x2, x3)
append_in(x0, x1)
U6(x0, x1)
U4(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule SHANOI_IN(s(s(X)), A, B, C) → U11(A, B, C, eq_in(s(X))) at position [3] we obtained the following new rules:

SHANOI_IN(s(s(X)), A, B, C) → U11(A, B, C, eq_out(s(X)))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U11(A, B, C, eq_out(N1)) → U21(A, B, C, N1, shanoi_in(N1, A, C, B))
U21(A, B, C, N1, shanoi_out(M1)) → SHANOI_IN(N1, B, A, C)
U11(A, B, C, eq_out(N1)) → SHANOI_IN(N1, A, C, B)
SHANOI_IN(s(s(X)), A, B, C) → U11(A, B, C, eq_out(s(X)))

The TRS R consists of the following rules:

shanoi_in(s(s(X)), A, B, C) → U1(A, B, C, eq_in(s(X)))
eq_in(X) → eq_out(X)
U1(A, B, C, eq_out(N1)) → U2(A, B, C, N1, shanoi_in(N1, A, C, B))
shanoi_in(s(0), A, B, C) → shanoi_out(.(mv(A, C), []))
U2(A, B, C, N1, shanoi_out(M1)) → U3(A, C, M1, shanoi_in(N1, B, A, C))
U3(A, C, M1, shanoi_out(M2)) → U4(M2, append_in(M1, .(mv(A, C), [])))
append_in(.(H, L), L1) → U6(H, append_in(L, L1))
append_in([], L) → append_out(L)
U6(H, append_out(R)) → append_out(.(H, R))
U4(M2, append_out(T)) → U5(append_in(T, M2))
U5(append_out(M)) → shanoi_out(M)

The set Q consists of the following terms:

shanoi_in(x0, x1, x2, x3)
eq_in(x0)
U1(x0, x1, x2, x3)
U2(x0, x1, x2, x3, x4)
U3(x0, x1, x2, x3)
append_in(x0, x1)
U6(x0, x1)
U4(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


SHANOI_IN(s(s(X)), A, B, C) → U11(A, B, C, eq_out(s(X)))
The remaining pairs can at least be oriented weakly.

U11(A, B, C, eq_out(N1)) → U21(A, B, C, N1, shanoi_in(N1, A, C, B))
U21(A, B, C, N1, shanoi_out(M1)) → SHANOI_IN(N1, B, A, C)
U11(A, B, C, eq_out(N1)) → SHANOI_IN(N1, A, C, B)
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 0   
POL(0) = 0   
POL(SHANOI_IN(x1, x2, x3, x4)) = x1   
POL(U1(x1, x2, x3, x4)) = 0   
POL(U11(x1, x2, x3, x4)) = x4   
POL(U2(x1, x2, x3, x4, x5)) = 0   
POL(U21(x1, x2, x3, x4, x5)) = x4   
POL(U3(x1, x2, x3, x4)) = 0   
POL(U4(x1, x2)) = 0   
POL(U5(x1)) = 0   
POL(U6(x1, x2)) = 1   
POL([]) = 1   
POL(append_in(x1, x2)) = 1 + x1 + x2   
POL(append_out(x1)) = 1   
POL(eq_in(x1)) = 0   
POL(eq_out(x1)) = x1   
POL(mv(x1, x2)) = 0   
POL(s(x1)) = 1 + x1   
POL(shanoi_in(x1, x2, x3, x4)) = 0   
POL(shanoi_out(x1)) = 0   

The following usable rules [17] were oriented: none



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U11(A, B, C, eq_out(N1)) → U21(A, B, C, N1, shanoi_in(N1, A, C, B))
U21(A, B, C, N1, shanoi_out(M1)) → SHANOI_IN(N1, B, A, C)
U11(A, B, C, eq_out(N1)) → SHANOI_IN(N1, A, C, B)

The TRS R consists of the following rules:

shanoi_in(s(s(X)), A, B, C) → U1(A, B, C, eq_in(s(X)))
eq_in(X) → eq_out(X)
U1(A, B, C, eq_out(N1)) → U2(A, B, C, N1, shanoi_in(N1, A, C, B))
shanoi_in(s(0), A, B, C) → shanoi_out(.(mv(A, C), []))
U2(A, B, C, N1, shanoi_out(M1)) → U3(A, C, M1, shanoi_in(N1, B, A, C))
U3(A, C, M1, shanoi_out(M2)) → U4(M2, append_in(M1, .(mv(A, C), [])))
append_in(.(H, L), L1) → U6(H, append_in(L, L1))
append_in([], L) → append_out(L)
U6(H, append_out(R)) → append_out(.(H, R))
U4(M2, append_out(T)) → U5(append_in(T, M2))
U5(append_out(M)) → shanoi_out(M)

The set Q consists of the following terms:

shanoi_in(x0, x1, x2, x3)
eq_in(x0)
U1(x0, x1, x2, x3)
U2(x0, x1, x2, x3, x4)
U3(x0, x1, x2, x3)
append_in(x0, x1)
U6(x0, x1)
U4(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 3 less nodes.